package com.youlu.campus.admin.ca.controller;

import com.youlu.campus.entity.ca.dto.CaReceiveSaveDTO;
import com.youlu.campus.entity.ca.dto.CaReceiveSearchDTO;
import com.youlu.campus.service.ca.CaReceiveAdminService;
import com.yuelin.infrastructure.quantum.common.QResult;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;
import javax.validation.Valid;

/**
 * @author : [dengbo]
 * @className : CaReceiveController
 * @description : [描述说明该类的功能]
 * @createTime : [2022/9/6 16:53]
 */
@RestController
@Slf4j
public class CaReceiveController {
    @Autowired
    private CaReceiveAdminService caReceiveAdminService;

    @PostMapping("/ca/not/receive/save")
    public QResult save(@RequestBody @Valid CaReceiveSaveDTO req) {
        return QResult.success(caReceiveAdminService.save(req));
    }

    @PostMapping("/ca/not/receive/page/info")
    public QResult pageInfo(@RequestBody @Valid CaReceiveSearchDTO req) {
        return QResult.success(caReceiveAdminService.list(req));
    }
}
